1 Transects

Plant Flowers Date lon lat ele Month Year julian
Glossoloma oblongicalyx 4 2015-10-19 -78.59093 0.130838 2270 October 2015 292
Gasteranthus quitensis 2 2016-10-17 -78.59770 0.120070 1940 October 2016 291
Kohleria affinis 1 2016-12-13 -78.59534 0.126746 2110 December 2016 348
Columnea ciliata 3 2014-02-27 -78.59934 0.116682 1960 February 2014 58
Columnea medicinalis 1 2014-04-23 -78.59372 0.128700 2130 April 2014 113
Drymonia teuscheri 3 2016-07-28 -78.59245 0.129393 2200 July 2016 210

2 Phylogeny

3 Traits

Plant Flowers Date lon lat ele Month Year julian
Glossoloma oblongicalyx 4 2015-10-19 -78.59093 0.130838 2270 October 2015 292
Gasteranthus quitensis 2 2016-10-17 -78.59770 0.120070 1940 October 2016 291
Kohleria affinis 1 2016-12-13 -78.59534 0.126746 2110 December 2016 348
Columnea ciliata 3 2014-02-27 -78.59934 0.116682 1960 February 2014 58
Columnea medicinalis 1 2014-04-23 -78.59372 0.128700 2130 April 2014 113
Drymonia teuscheri 3 2016-07-28 -78.59245 0.129393 2200 July 2016 210

3.0.1 Total Flowers

3.1 Peak date

3.2 Julian Day

## sink("model/normal_julian.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
## 
##       #observation
##       Yobs[x] ~ dnorm(mu[Plant[x]],tau[Plant[x]])T(0,365)
##       
##       #Residuals
##       residuals[x] <- Yobs[x] - mu[Plant[x]]
##       
##       #squared error
##       sq[x]<-pow(residuals[x],2)
## 
##       #Assess Model Fit - squared residuals
##       Ynew[x] ~ dnorm(mu[Plant[x]],tau[Plant[x]])T(0,365)
##       sq.new[x]<-pow(Ynew[x] - mu[Plant[x]],2)
##     
##     }
##     
##     #Root mean squared residuals
##     fit<-sqrt(sum(sq[])/Nobs)
##     fitnew<-sqrt(sum(sq.new[])/Nobs)  
## 
##     #Prediction
## 
##     for(i in 1:Npreds){
## 
##       #predict value
##       prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##     
##       #squared predictive error
##       pred_error[i] <- pow(Ypred[i] - prediction[i],2)
##     }
## 
##     #Root Mean Squared Predictive Error
##     fitpred<-sqrt(sum(pred_error[])/Npreds)
## 
##     #Priors
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #Intercept
##     mu[j] ~ dnorm(0,0.0001)
## 
##     #variance
##     sigma[j] ~ dunif(0,75)
##     tau[j] <- pow(sigma[j], -2)
##     } 
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 7309
##    Unobserved stochastic nodes: 8715
##    Total graph size: 45223
## 
## Initializing model

3.2.1 Evaluate convergence

3.2.2 Posterior estimates

3.2.3 Estimated phenology

Red is the kernel density from the underlying data Black is the modeled phenology

4 Phylogeny

4.1 Attraction

## sink("model/normal_attraction.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
## 
##       #observation
##       mu[x] <-  alpha + e[Plant[x]]
##       Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##       
##       #Residuals
##       residuals[x] <- Yobs[x] - mu[x]
##       
##       #squared error
##       sq[x]<-pow(residuals[x],2)
## 
##       #Assess Model Fit - squared residuals
##       Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##       sq.new[x]<-pow(Ynew[x] - mu[x],2)
##     
##     }
##     
##     #Root mean squared error
##     fit<-sqrt(sum(sq[])/Nobs)
##     fitnew<-sqrt(sum(sq.new[])/Nobs)
## 
##     #autocorrelation in error
##     e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
##     
##     ## Covert variance to precision for each parameter
##     
##     iC=inverse(omega*C[,])
##     tauC=iC
##     tauC2=iC
##     
##     ###########
##     #Prediction
##     ###########
## 
##     for(i in 1:Npreds){
##     
##     #predict value
##     prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##     
##     #squared predictive error
##     pred_error[i] <- pow(Ypred[i] - prediction[i],2)
##     }
##     
##     #Root Mean Squared Predictive Error
##     fitpred<-sqrt(sum(pred_error[])/Npreds)
##     
##     # Priors #
##     ##########
## 
##     #Species level priors
##     
##     for (j in 1:Plants){
## 
##     #variance
##     sigma[j] ~ dunif(0,75)
##     tau[j] <- pow(sigma[j], -2)
##     } 
## 
##     #Intercept
##     alpha ~ dnorm(0,0.0001)
## 
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
## 
##     #Magnitude of the phylogenetic effect
##     omega ~ dunif(0,20)
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 6991
##    Unobserved stochastic nodes: 8286
##    Total graph size: 43304
## 
## Initializing model

5 Get Chains

5.0.1 Evaluate convergence

5.0.2 Posterior estimates

5.0.3 Estimated phenology

Red is the kernel density from the underlying data Black is the model

5.1 Decay in phylogenetic attraction

5.2 Repulsion

## sink("model/normal_repulsion.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
##     
##     #observation
##     mu[x] <- alpha + e[Plant[x]]
##     Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##     
##     #Residuals
##     residuals[x] <- Yobs[x] - mu[x]
##     
##     #squared error
##     sq[x]<-pow(residuals[x],2)
##     
##     #Assess Model Fit - squared residuals
##     Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##     sq.new[x]<-pow(Ynew[x] - mu[x],2)
##     
##     }
##     
##     #sum of squared error
##     #Root mean squared error
##     fit<-sqrt(sum(sq[])/Nobs)
##     fitnew<-sqrt(sum(sq.new[])/Nobs)
##     
##     #autocorrelation in error
##     e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
##     
##     #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
##     #For clarity sake this is performed, even though it is undone by converting to precision
##     iC=inverse(omega * C[,])
##     
##     ## Covert variance to precision for each parameter
##     
##     iiC=inverse(iC[,])
##     tauC=iiC
##     tauC2=iiC
##     
##     ###########
##     #Prediction
##     ###########
## 
##     for(i in 1:Npreds){
##     
##     #predict value
##     prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##     
##     #squared predictive error
##     pred_error[i] <- pow(Ypred[i] - prediction[i],2)
##     }
##     
##     #Root Mean Squared Predictive Error
##     fitpred<-sqrt(sum(pred_error[])/Npreds)
##     
##     # Priors #
##     ##########
##     
##     #Julian Intercept
##     alpha ~ dnorm(0,0.0001)
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #variance
##     sigma[j] ~ dunif(0,75)
##     tau[j] <- pow(sigma[j], -2)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     omega ~ dunif(0,20)
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 6991
##    Unobserved stochastic nodes: 8286
##    Total graph size: 43305
## 
## Initializing model

6 Get Chains

6.0.1 Evaluate convergence

6.0.2 Posterior estimates

6.0.3 Estimated phenology

Red is the kernel density from the underlying data Black is the model

6.1 Decay in phylogenetic repulsion

7 Traits

7.1 Trait Attraction

## sink("model/normal_attraction.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
## 
##       #observation
##       mu[x] <-  alpha + e[Plant[x]]
##       Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##       
##       #Residuals
##       residuals[x] <- Yobs[x] - mu[x]
##       
##       #squared error
##       sq[x]<-pow(residuals[x],2)
## 
##       #Assess Model Fit - squared residuals
##       Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##       sq.new[x]<-pow(Ynew[x] - mu[x],2)
##     
##     }
##     
##     #Root mean squared error
##     fit<-sqrt(sum(sq[])/Nobs)
##     fitnew<-sqrt(sum(sq.new[])/Nobs)
## 
##     #autocorrelation in error
##     e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
##     
##     ## Covert variance to precision for each parameter
##     
##     iC=inverse(omega*C[,])
##     tauC=iC
##     tauC2=iC
##     
##     ###########
##     #Prediction
##     ###########
## 
##     for(i in 1:Npreds){
##     
##     #predict value
##     prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##     
##     #squared predictive error
##     pred_error[i] <- pow(Ypred[i] - prediction[i],2)
##     }
##     
##     #Root Mean Squared Predictive Error
##     fitpred<-sqrt(sum(pred_error[])/Npreds)
##     
##     # Priors #
##     ##########
## 
##     #Species level priors
##     
##     for (j in 1:Plants){
## 
##     #variance
##     sigma[j] ~ dunif(0,75)
##     tau[j] <- pow(sigma[j], -2)
##     } 
## 
##     #Intercept
##     alpha ~ dnorm(0,0.0001)
## 
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
## 
##     #Magnitude of the phylogenetic effect
##     omega ~ dunif(0,20)
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 7302
##    Unobserved stochastic nodes: 8692
##    Total graph size: 45641
## 
## Initializing model

8 Get Chains

8.0.1 Evaluate convergence

8.0.2 Posterior estimates

8.0.3 Estimated phenology

Red is the kernel density from the underlying data Black is the model

8.1 Decay in trait attraction

8.2 Repulsion

## sink("model/normal_repulsion.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
##     
##     #observation
##     mu[x] <- alpha + e[Plant[x]]
##     Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##     
##     #Residuals
##     residuals[x] <- Yobs[x] - mu[x]
##     
##     #squared error
##     sq[x]<-pow(residuals[x],2)
##     
##     #Assess Model Fit - squared residuals
##     Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##     sq.new[x]<-pow(Ynew[x] - mu[x],2)
##     
##     }
##     
##     #sum of squared error
##     #Root mean squared error
##     fit<-sqrt(sum(sq[])/Nobs)
##     fitnew<-sqrt(sum(sq.new[])/Nobs)
##     
##     #autocorrelation in error
##     e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
##     
##     #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
##     #For clarity sake this is performed, even though it is undone by converting to precision
##     iC=inverse(omega * C[,])
##     
##     ## Covert variance to precision for each parameter
##     
##     iiC=inverse(iC[,])
##     tauC=iiC
##     tauC2=iiC
##     
##     ###########
##     #Prediction
##     ###########
## 
##     for(i in 1:Npreds){
##     
##     #predict value
##     prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##     
##     #squared predictive error
##     pred_error[i] <- pow(Ypred[i] - prediction[i],2)
##     }
##     
##     #Root Mean Squared Predictive Error
##     fitpred<-sqrt(sum(pred_error[])/Npreds)
##     
##     # Priors #
##     ##########
##     
##     #Julian Intercept
##     alpha ~ dnorm(0,0.0001)
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #variance
##     sigma[j] ~ dunif(0,75)
##     tau[j] <- pow(sigma[j], -2)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     omega ~ dunif(0,20)
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 7302
##    Unobserved stochastic nodes: 8692
##    Total graph size: 45642
## 
## Initializing model

9 Get Chains

9.0.1 Evaluate convergence

9.0.2 Posterior estimates

9.0.3 Estimated phenology

Red is the kernel density from the underlying data Black is the model

9.1 Decay in trait repulsion

10 Model Comparison

10.1 Alpha

10.2 E: The effect of autocorrelation on mean flowering date

10.2.1 Estimated phenology density

10.3 Effect of autocorrelation

10.4 Decay in autocorrelation effect

11 Model Fit

11.1 Bayesian pvalue

## # A tibble: 5 x 2
##   Model                       p
##   <chr>                   <dbl>
## 1 julian                      0
## 2 phylogenetic_attraction     0
## 3 phylogenetic_repulsion      0
## 4 trait_attraction            0
## 5 trait_repulsion             0

11.2 Overall

11.3 By Species

12 Prediction